<?php
/*
 * 意见建议
 */
namespace app\admin\controller;
use think\Db;
use think\Request;

class Facebook extends Comm
{

    public function add($act = null)
    {

        if ($act) {
            $data['content'] = input('post.content', '', 'strip_tags');
            if ($data['content'] == '') {
                $this->error('反馈内容不能为空！');
            }
            $data['v'] = config('Version');
            $data['url'] = $_SERVER['SERVER_NAME'];

			$url = "http://myup.56z4.com/api.php/fk/add";
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_HEADER, 0);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
            $r = curl_exec($ch);
			//var_dump($r);die;
            if ($r == 'ok') {
                //$this->success('感谢您的反馈！');
				return json(array('code' => 200, 'msg' => '感谢您的反馈'));	
                exit(0);
            } else {
                //$this->error('系统错误，请稍后再试！');
				return json(array('code' => 0, 'msg' => '系统错误，请稍后再试！'));	
            }
        }

        return $this->fetch();
    }


    
	
	
	
	
}
